package simbot.example.config;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.context.annotation.Configuration;
import simbot.example.utils.client.HttpClientUtil;

/**
 * 应用关闭时较晚的善后
 *
 * @author minmin
 * @since 2021/07/10 11:27
 */
@Configuration
public class AppClosedConfig implements DisposableBean, ExitCodeGenerator {
    @Override
    public void destroy() throws Exception {
        HttpClientUtil.close();
    }

    @Override
    public int getExitCode() {
        return 0;
    }
}
